//
//  MLASavePinPutInCell.m
//  MagicLampApp
//
//  Created by Zheng on 2018/12/24.
//  Copyright © 2018 zheng.magic.lamp.app. All rights reserved.
//

#import "MLASavePinPutInCell.h"
#import "MLASavePinPutInOutModel.h"

@interface MLASavePinPutInCell ()

@end

@implementation MLASavePinPutInCell {
    UILabel *nameLbl;
    UILabel *warehouseLbl;
    UILabel *numLbl;
    UILabel *cateLbl;
    
    UILabel *dateLbl;
    UILabel *buyerLbl;
    UILabel *checkLbl;
}

- (void)setModel:(MLASavePinPutInOutModel *)model {
    _model = model;
    
    nameLbl.text = [NSString stringWithFormat:@"名称：%@",_model.name];
    warehouseLbl.text = [NSString stringWithFormat:@"仓库名：%@",_model.room_name];
    numLbl.text = [NSString stringWithFormat:@"数量：%@",_model.sum];
    cateLbl.text = [NSString stringWithFormat:@"类别：%@",_model.type_name];
    dateLbl.text = _model.time;
    buyerLbl.text = [NSString stringWithFormat:@"采购员：%@",_model.apply_name];
    checkLbl.text = [NSString stringWithFormat:@"核验人：%@",_model.audit_name];

}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        nameLbl = [[UILabel alloc] init];
        nameLbl.font = CX_GetNormalFont(12);
        nameLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:nameLbl];
        [nameLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.mas_equalTo(20);
        }];
        
        warehouseLbl = [[UILabel alloc] init];
        warehouseLbl.font = CX_GetNormalFont(12);
        warehouseLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:warehouseLbl];
        [warehouseLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.equalTo(self->nameLbl.mas_bottom).offset(8);
        }];
        
        numLbl = [[UILabel alloc] init];
        numLbl.font = CX_GetNormalFont(12);
        numLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:numLbl];
        [numLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.equalTo(self->warehouseLbl.mas_bottom).offset(8);
        }];

        cateLbl = [[UILabel alloc] init];
        cateLbl.font = CX_GetNormalFont(12);
        cateLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:cateLbl];
        [cateLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.equalTo(self->numLbl.mas_bottom).offset(8);
        }];

        dateLbl = [[UILabel alloc] init];
        dateLbl.textColor = CX_GetColorHex(0x999999, 1);
        dateLbl.font = CX_GetNormalFont(10);
        [self.shadowView addSubview:dateLbl];
        [dateLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.top.mas_equalTo(20);
        }];
        
        buyerLbl = [[UILabel alloc] init];
        buyerLbl.font = CX_GetNormalFont(12);
        buyerLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:buyerLbl];
        [buyerLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self->numLbl);
        }];

        checkLbl = [[UILabel alloc] init];
        checkLbl.font = CX_GetNormalFont(12);
        checkLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:checkLbl];
        [checkLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self->cateLbl);
        }];

        /*
         nameLbl.text = @"名称：本子";
         warehouseLbl.text = @"仓库名：A库房";
         numLbl.text = @"数量：10本";
         cateLbl.text = @"类别：办公用品";
         dateLbl.text = @"2018.9.9 12：21";
         buyerLbl.text = @"采购人：张三";
         checkLbl.text = @"核验人：李四";

         */
    }
    return self;
}




@end
